package com.lhc.HomeWork;

public class Student implements Comparable<Student>{
    //成员变量
    private String stuName;

    private double stuScore;


    @Override
    public int compareTo(Student stu) {
        int reVal=0;
        if(this.getStuScore()>stu.getStuScore())
        {
           reVal=1;
        }
        else if(this.getStuScore()<stu.getStuScore())
        {
            reVal=-1;
        }
        return reVal;
    }

    @Override
    public String toString() {
        return
                "stuName:" + stuName +
                "\tstuScore:" + stuScore ;
    }


    //Student类的构造方法


    public Student() {

    }

    public Student(String stuName, double stuScore) {
        this.stuName = stuName;
        this.stuScore = stuScore;
    }

    //

    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public double getStuScore() {
        return stuScore;
    }

    public void setStuScore(double stuScore) {
        this.stuScore = stuScore;
    }
}
